

<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
        <meta name="layout" content="main" />
		<resource:dateChooser />
        <title>Create Report</title>         
    </head>
    <body>
        <div class="nav">
            <span class="menuButton"><a class="home" href="${createLinkTo(dir:'')}">Home</a></span>
            <span class="menuButton"><g:link class="list" action="list">Report List</g:link></span>
        </div>
        <div class="body">
            <h1>Create Report</h1>
            <g:if test="${flash.message}">
            <div class="message">${flash.message}</div>
            </g:if>
            <g:hasErrors bean="${report}">
            <div class="errors">
                <g:renderErrors bean="${report}" as="list" />
            </div>
            </g:hasErrors>
            <g:form action="save" method="post" >
                <div class="dialog">
                    <table>
                        <tbody>
                        
                            <tr class="prop">
                                <td valign="top" class="name">
                                    <label for="reportSystem">System:</label>
                                </td>
                                <td valign="top" class="value ${hasErrors(bean:report,field:'reportSystem','errors')}">
                                    <g:select optionKey="id" from="${ReportSystem.list()}" name="reportSystem.id" value="${report?.reportSystem?.id}" ></g:select>
                                </td>
                            </tr> 
                        
                            <tr class="prop">
                                <td valign="top" class="name">
                                    <label for="reportName">Report Name:</label>
                                </td>
                                <td valign="top" class="value ${hasErrors(bean:report,field:'reportName','errors')}">
                                    <input class="orderByText" type="text" maxlength="100" id="reportName" name="reportName" value="${fieldValue(bean:report,field:'reportName')}"/>
                                </td>
                            </tr> 
                        
                            <tr class="prop">
                                <td valign="top" class="name">
                                    <label for="reportTitle">Report Title:</label>
                                </td>
                                <td valign="top" class="value ${hasErrors(bean:report,field:'reportTitle','errors')}">
                                    <input class="orderByText" type="text" maxlength="200" id="reportTitle" name="reportTitle" value="${fieldValue(bean:report,field:'reportTitle')}"/>
                                </td>
                            </tr> 
                        	
                            <tr class="prop">
                                <td valign="top" class="name">
                                    <label for="showReport">Show Report:</label>
                                </td>
                                <td valign="top" class="value ${hasErrors(bean:report,field:'showReport','errors')}">
                                    <g:select id="showReport" name="showReport" from="${report.constraints.showReport.inList.collect{it.encodeAsHTML()}}" value="${fieldValue(bean:report,field:'showReport')}" ></g:select>
                                </td>
                            </tr> 
                        
                            <tr class="prop">
                                <td valign="top" class="name">
                                    <label for="orderByClauseOverride">Order By Clause Override:</label>
                                </td>
                                <td valign="top" class="value ${hasErrors(bean:report,field:'orderByClauseOverride','errors')}">
                                    <input type="text" id="orderByClauseOverride" name="orderByClauseOverride" 
									       class="orderByText" 
									       value="${fieldValue(bean:report,field:'orderByClauseOverride')}"/>
                                </td>
                            </tr> 
                        
                            <tr class="prop">
                                <td valign="top" class="name">
                                    <label for="designer">Designer:</label>
                                </td>
                                <td valign="top" class="value ${hasErrors(bean:report,field:'designer','errors')}">
                                    <input type="text" id="designer" name="designer" value="${fieldValue(bean:report,field:'designer')}"/>
                                </td>
                            </tr> 
                        
                            <tr class="prop">
                                <td valign="top" class="name">
                                    <label for="userResponsible">User Responsible:</label>
                                </td>
                                <td valign="top" class="value ${hasErrors(bean:report,field:'userResponsible','errors')}">
                                    <input type="text" id="userResponsible" name="userResponsible" value="${fieldValue(bean:report,field:'userResponsible')}"/>
                                </td>
                            </tr> 
                        
                            <tr class="prop">
                                <td valign="top" class="name">
                                    <label for="comments">Comments:</label>
                                </td>
                                <td valign="top" class="value ${hasErrors(bean:report,field:'comments','errors')}">
                                    <textarea rows="5" cols="40" name="comments">${report?.comments?.encodeAsHTML()}</textarea>
                                </td>
                            </tr> 
                        
                            <tr class="prop">
                                <td valign="top" class="name">
                                    <label for="reportEnded">Report Ended:</label>
                                </td>
                                <td valign="top" class="value ${hasErrors(bean:report,field:'reportEnded','errors')}">
                                    <g:select id="reportEnded" name="reportEnded" from="${report.constraints.reportEnded.inList.collect{it.encodeAsHTML()}}" value="${fieldValue(bean:report,field:'reportEnded')}" ></g:select>
                                </td>
                            </tr> 
                        
                        </tbody>
                    </table>
                </div>
                <div class="buttons">
                    <span class="button"><input class="save" type="submit" value="Create" /></span>
                </div>
            </g:form>
        </div>
    </body>
</html>
